﻿@page "/achievement"
@namespace SwashbucklerDiary.Pages
@inherits ImportantComponentBase

<MyAppBar>
    <MButton Icon="true"
             OnClick="NavigateToBack">
        <MIcon>
            mdi-arrow-left
        </MIcon>
    </MButton>

    <MySearch @bind-Value="ShowSearch"
              @bind-Search="Search"
              Title="@(I18n.T("Mine.Achievement.Name"))"
              OnChanged="UpdateAchievements">
    </MySearch>

    <MButton Icon="true"
             OnClick="()=>ShowSearch=!ShowSearch">
        <MIcon>
            mdi-magnify
        </MIcon>
    </MButton>
</MyAppBar>

<ScrollContainer>
    <div class="d-flex justify-space-between flex-wrap">
        @foreach (var item in Achievements)
        {
            <AchievementCard Value="item"></AchievementCard>
        }
    </div>

    <EmptyContent Show="!string.IsNullOrEmpty(Search)"></EmptyContent>
</ScrollContainer>
